package city.spring.modules.oldman.repository;

import city.spring.modules.oldman.entity.ServiceReservationRecordEntity;
import city.spring.modules.oldman.vo.ServiceReservationRecordEntityVO;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 存储库：
 * 服务预定记录
 *
 * @author pxm
 * @date 2020-08-19 15:52:29
 */
@Repository
public interface ServiceReservationRecordRepository extends BaseMapper<ServiceReservationRecordEntity> {
    /**
     * 分页获取服务预定记录
     *
     * @param page    分页对象
     * @param wrapper 查询对象
     * @return 消服务预定记录
     */
    IPage<ServiceReservationRecordEntityVO> listPage(Page<? extends ServiceReservationRecordEntity> page, @Param(Constants.WRAPPER) Wrapper<? extends ServiceReservationRecordEntity> wrapper);

    /**
     * 服务订单执行状态更改
     *
     * @param id
     * @param entity
     */
    void orderStatusChange(String id, ServiceReservationRecordEntity entity);

    /**
     * 退住结算： 获取未执行订单 的相关信息 ，用于结算前的预定服务的退款
     *
     * @param oldmanId
     * @return
     */
    List<ServiceReservationRecordEntityVO> getUnExecutedProject(String oldmanId);
}